import { configureStore } from '@reduxjs/toolkit';
import counterSlicer from './modules/counter'
import randomListSlice from './modules/randomNumberList'

// 1. create store
const store = configureStore({
    reducer: {
        counter: counterSlicer,
        randomNumberList: randomListSlice
    }
});

/**
 * If you pass the reducers directly to configureStore() and do not define the root reducer explicitly, 
 * there is no reference to rootReducer. Instead, you can refer to store.getState, in order to get the State type.
 */
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;

export default store;
